<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/base.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/style.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
		<title>财务管理-提现明细</title>
	</head>
	<body>
		<div class="page">
			<div class="header">
				<div class="header_top"></div>
				<div class="header_bottom clearfix">
					<div class="header_logo fl">
						<img src="${pageContext.request.contextPath}/images/images/index-logo.png">
					</div>
					<ul class="header_nav clearfix fl">
						<li>
							<a href="${pageContext.request.contextPath}/morder/waitOrderList.html" >订单管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/staff/queryAllList/1.html">家政人员管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/supplier/account.html" class="on">财务管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/admin/accountInfo.html" >账户管理</a>
						</li>
					</ul>
					<div class="header_user fr">
						<img src="${pageContext.request.contextPath}/images/images/user.png">欢迎您，<i>${ sessionScope.MANAGER_NAME} </i><a href="${pageContext.request.contextPath}/manager/loginout.html">【切换账号】</a>
					</div>
				</div>
			</div>
			<div class="main clearfix">
				<div class="main_menu fl">
					<div class="menu_name ">
						<a href="${pageContext.request.contextPath}/supplier/account.html">
							<img src="${pageContext.request.contextPath}/images/images/zhxx.png">
							<p>账户信息</p>
						</a>
					</div>
					<%-- <div class="menu_name">
						<a href="${pageContext.request.contextPath}/supplier/exAndReInfo.html">
							<img src="${pageContext.request.contextPath}/images/images/szmx.png">
							<p>收支明细</p>
						</a>
					</div> --%>
					<div class="menu_name ">
						<a href="${pageContext.request.contextPath}/supplier/withDrawInfo/1.html">
							<img src="${pageContext.request.contextPath}/images/images/txmx.png">
							<p>提现明细</p>
						</a>
					</div>
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/supplier/smsInfo/1.html">
							<img src="${pageContext.request.contextPath}/images/images/dxgl.png">
							<p>短信管理</p>
						</a>
					</div>
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/supplier/heiInfo/1.html">
							<img src="${pageContext.request.contextPath}/images/images/hbgl.png">
							<p>嘿币管理</p>
						</a>
					</div>
					<div class="menu_name gzjs on">
						<a href="${pageContext.request.contextPath}/supplier/topayRecord.html">
							<img src="${pageContext.request.contextPath}/images/images/sqtx.png">
							<p>申请提现</p>
						</a>
					</div>
				</div>
				<div class="main_cont fl">
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_title fl">当前位置：财务管理 > 申请提现</div>
							<div class="cont_top_time fr"><i><img src="${pageContext.request.contextPath}/images/images/refresh.png">
							<a href="${pageContext.request.contextPath}/supplier/withDrawInfo/1.html">刷新</a>
							</i></div>
						</div>
					</div>
					
					<div class="main_cont_bottom">
					<div class="application" >
				
					<div class="application_main">
						<form action="${pageContext.request.contextPath}/supplier/payRecord.html" method="post" class="form form-horizontal" id="withDrawForm">
						<div class="application_list"><span><i>*</i>提现金额：</span><input type="text" class="mr25" id="wPAmount" name="wPAmount" datatype="*1-20" nullmsg="金额不能为空" onblur="feeValue()">【可提现金额：${totals}元】</div>
						<div class="application_list clearfix">
							<span class="tc fl">手续费：</span>
							<div class="sxf fl">
								<p><span id="wfee"></span>元</p>
								<p>温馨提示：微信每次提现会收取提现总额的0.6%手续费</p>
								<p>由此产生的不便望理解，感谢支持，谢谢理解！</p>
							</div>
							<input type="hidden" name="wPFee" id="wPFee">
						</div>
						<div class="application_list clearfix">  
							<span class="fl"><i>*</i>银行名称：</span>
							<div class="bank fl">
							<input type="text" class="input-text" placeholder="" name="wPBankName" id="wPBankName" datatype="*2-20" nullmsg="银行名称不能为空">	
							</div>
						</div>
						<div class="application_list"><span><i>*</i>开户行名称：</span><input type="text" name="wPBankDiopsit" id="wPBankDiopsit" datatype="*2-20" nullmsg="开户行名称不能为空"></div>
						<div class="application_list"><span><i>*</i>银行账号：</span><input type="number" name="wPBankNo" id="wPBankNo" datatype="*" nullmsg="银行账号不能为空"></div>
						<div class="application_list"><span><i>*</i>持卡人姓名：</span><input type="text" name="wPAccountName" id="wPAccountName" datatype="*2-20" nullmsg="账户名称不能为空"></div>
						<div class="application_list"><span><i>*</i>联系人电话：</span><input type="number" pattern="[0-9]*" placeholder="请输入手机号码" id="mobile" name="wMMobile"  maxlength="11"></div>
						<div class="application_list clearfix"><span class="tc fl" style="line-height: 92px;">补充说明：</span><textarea id="wPDesc"></textarea></div>
						<div class="application_list" style=" display:none;" id="tip"> <span id="tipMsg"></span> </div>
						<input type="hidden" name="wSType" value="1">
						<input  class="baocun" type="button" value="提交" onclick="tijiao();" >
					</form>
					</div>
					
					</div>
				</div>
					
					
				</div>
			</div>
		</div>
		
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/layer/2.1/layer.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/laypage/1.2/laypage.js"></script> 
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/My97DatePicker/WdatePicker.js"></script> 
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
		<script>
			$(function(){
				$('.table-sort').dataTable({
					"bLengthChange": false, //改变每页显示数据数量
					"aaSorting": [[ 1, "desc" ]],//默认第几个排序
					"bStateSave": true,//状态保存
					"bPaginate" : false,// 分页按钮  
					"aoColumnDefs": [
				  	//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				  	{"orderable":false,"aTargets":[0,2,2]}// 制定列不参与排序
					]
				});
			});
			
				$(".gzjs").on("click",function(){
					$(".mask_sqtx").show();
				});
				$(".close").on("click",function(){
					$(".mask_sqtx").hide();
					$('#wPAmount').val("");
					$('#wPFee').val("");
					$('#wfee').html("");
				});
				 
				function tijiao(){
				 	var mobile = $("#mobile").val();
			     	var amount = $('#wPAmount').val();
			     	var totals="${totals}";
			     	var wPBankName=$("#wPBankName").val();
			     	var wPBankDiopsit=$("#wPBankDiopsit").val();
			     	var wPBankNo=$("#wPBankNo").val();
			     	var wPAccountName=$("#wPAccountName").val();
			     	
			     	var t =parseFloat(totals);
			     	if(t<0){
			     		alert("可提现金额小于0，不能提现！");
						return false;
			     	}
			     	
			     	if(isNaN(amount)  || amount=="" || amount==null){
						alert("提现金额请输入数字！");
						return false;
					}
			     	
			     	var f =parseFloat(amount);
			     	
			     	if(f<1){
			     		alert("请输入大于 1 有效的提现金额！");
						return false;
			     	}
			     	
			     	if(f>t){
			     		alert("提现金额大于总金额，不能提现！");
						return false;
			     	}
			     	
			     	var fee=$('#wPFee').val();
			     	if(fee==null || fee==""){
			     		alert("手续费为空，不能提现！");
						return false;
			     	}
			     	
			     	
			     	if(wPBankName==null || wPBankName==""){
			     		alert("请输入银行名字！");
						return false;
			     	}
			     	if(wPBankDiopsit==null || wPBankDiopsit==""){
			     		alert("请输入开户银行名字！");
						return false;
			     	}
			     	if(wPBankNo==null || wPBankNo==""){
			     		alert("请输入银行账号！");
						return false;
			     	}
			     	var resg=/^[0-9]*$/;
			     	if(!resg.test(wPBankNo)){
			     		alert("请输入有效银行账号！并确认无误！");
						return false;
			     	}
			     	if(wPAccountName==null || wPAccountName==""){
			     		alert("请输入持卡人的姓名！");
						return false;
			     	}
			 	   	if(mobile == '' || mobile==null || isNaN(mobile)) {
				   		alert("请输入手机号码");
			 		  	return false; 
			 	   	}
			 	   if(!(/^1(3|4|5|7|8)\d{9}$/.test(mobile))){    
						alert("请输入有效的手机号码！");    
						return false;  
					} 
			 	   
				  $("#withDrawForm").submit();
			 	}
				
				//手续费
				function feeValue() { 
					var amount = $("#wPAmount").val();
					if(isNaN(amount)  || amount=="" || amount==null){
						alert("提现金额请输入数字！");
						return false;
					}
			     	
					var f =parseFloat(amount);
			     	if(f<1){
			     		alert("请输入大于 1 有效的提现金额！");
						return false;
			     	}
			     	var wfee=(f*0.006).toFixed(2);
			     	if(wfee>0){
			     		$('#wfee').html(wfee);
			     		$('#wPFee').val(wfee);
			     	}else{
			     		$('#wfee').html("");
			     	}
				}
				
				
				
		</script>
	</body>
</html>
